package com.sunday.common.mongo.study.business;

import com.sunday.common.core.gson.GsonUtils;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

/**
 * @Description: 账号
 */
@Data
@Document("user")
public class User {

    // 主键
    @Id
    private Integer id;

    // 账户
    @Field("username")
    private String username;

    // 密码
    @Field("password")
    private String password;

    // 道具集合
    @Field("items")
    private Item[] items;

    @Override
    public String toString() {
        return GsonUtils.DEFAULT.toJson(this);
    }

}
